import java.util.*;

public class BoxDriver {

	public static void main(String[ ] args) {
		
		Scanner input = new Scanner(System.in);
		
		Box box1 = null, box2 = null, box3 = null;
		try {
			System.out.print("Enter the length, wedth, and height for the box1 [in cm]: ");
			box1 = new Box(input.nextDouble(), input.nextDouble(), input.nextDouble() );
			
			System.out.print("Enter the length, wedth, and height for the box2 [in cm]: ");
			box2 = new Box(input.nextDouble(), input.nextDouble(), input.nextDouble() );
			
			box3 = new Box (box1);
			
			input.close();
		}
		catch(IllegalArgumentException E) {
			System.out.println(E);
			System.exit(0);
		}
		
		
		        System.out.println("");
		        
		        System.out.printf("The volume of box1 is %.1f cubic cm.%n" , box1.volume());
		        System.out.printf("The surface area of box1 is %.1f square cm.%n%n" , box1.surfaceArea());
		        System.out.printf("The volume of box1 is %.1f cubic cm.%n" , box2.volume());
		        System.out.printf("The surface area of box1 is %.1f square cm.%n%n" , box2.surfaceArea());
		        
		        
		        System.out.println("Box1: " + box1.toString());
				System.out.println("Box2: " + box2.toString() + "\n");

				if (box1.equals1(box2))
					System.out.println("The boxes are equal.");
				else
					System.out.println("The boxes are not equal.\n");

		        System.out.println("Box3: " + box3.toString());

	}
}
